package com.sooncode.project.focusservice._.base;

import com.sooncode.project.core.generic.BasicAddEvent;
import com.sooncode.project.core.generic.BasicDeleteEvent;
import com.sooncode.project.core.generic.BasicModifyEvent;
import com.sooncode.project.core.model.DomainModel;

import java.util.Date;
import java.util.Map;

public abstract class BaseDomainModel<T> extends DomainModel<T> {
    public void add(Map<String,Object> map){
        map.put("createDate",new Date());
        causes(BasicAddEvent.class,map);
    }
    public void modify(Map<String,Object> map){
        causes(BasicModifyEvent.class,map);
    }
    public void delete(){
        causes(BasicDeleteEvent.class);
    }

}
